1. Field of the Invention
The present invention relates to a microcomputer, and particularly to a microcomputer that, as storage regions, is provided with a memory device such as a mask Read Only Memory (ROM) and an electrically erasable and writable nonvolatile semiconductor memory device such as a flash memory or Electrically Erasable and Programmable Read Only Memory (EEPROM).
2. Description of the Related Art
Generally, microcomputers are manufactured so as to receive both code that is programmed by the user and data that are consulted in accordance with the code and which must be stored according to the user's instructions (hereinbelow referred to as "user code/data") and to operate in accordance with this user code/data.
Because a microcomputer is conventionally provided with only mask ROM, which cannot be repeatedly rewritten (hereinbelow, a microcomputer provided with this configuration is referred to as a "microcomputer of the first example of the prior art"), this type of user code/data is inevitably stored in such mask ROM.
When the user code/data is to be modified, therefore, a microcomputer having the configuration of the first example of the prior art must be manufactured anew with the new user code/data, and this necessity is obviously disadvantageous from the viewpoint of cost.
To solve this problem of the first example of the prior art, microcomputers have been proposed in recent years that are provided with writable memory such as flash memory in place of mask ROM (such microcomputers are referred to as the second example of the prior art hereinbelow). A microcomputer according to the second example of the prior art operates according to user code/data that are written to, for example, flash memory, and when there is a modification of the user code/data, this change can be dealt with by rewriting the content of the flash memory.
However, in the configuration of the second example of the prior art, several problems have arisen along with the increase in the volume of the user code/data, i.e., increase in the size of applications. When the size of an application increases, the memory size for storing this user code/data must also increase. It is well known, however, that the size of memory cells in flash memory is generally much greater than the size of memory cells in mask ROM. As a result, if all of the user code/data are stored in flash memory, the chip size of the microcomputer expands with the increase in the application size, with the accompanying problem that chip cost increases accordingly.
A microcomputer has been proposed as the third embodiment of Japanese Patent Laid-open No. 266219/1993 (hereinbelow referred to as the third example of the prior art) as a means of balancing the problems inherent to the first and second examples of the prior art.
A microcomputer of the third example of the prior art is provided with both mask ROM and flash memory, and includes address space as shown in FIG. 1. In a microcomputer according to the third example of the prior art, programs or data that may require rewriting are stored in flash memory while programs or data that do not require rewriting are stored in mask ROM. Further, as will be understood by referring to FIG. 1, a rewrite control program for rewriting the content of flash memory is stored in mask ROM. A microcomputer having this configuration of the third example of the prior art can carry out rewriting in accordance with the rewrite control program stored in the mask ROM should the need arise to rewrite the content stored in the flash memory. As can also be understood from FIG. 1, data or programs not requiring rewriting and the rewrite control program reside in the same address space in the third example of the prior art and can mutually refer to each other.
Nevertheless, a microcomputer of the above-described third example of the prior art has the following problems when the rewrite control program is to be modified.
Rewrite control programs are generally subject to version upgrades. As can be understood by referring to FIG. 1, the rewrite control program in the third example of the prior art is arranged beginning from the leading address of the mask ROM, and in addition, resides in the same address space as the address space in which, for example, content within user code/data resides that does not require rewriting. Accordingly, if a rewrite control program undergoes a modification such as the upgrade is larger than the program before modification, a microcomputer of the third example of the prior art is subject to the problem that at least the area of user code/data stored in mask ROM will be encroached upon by the rewrite control program when the rewrite control program is modified.
In addition, when encroachment of the user code/data area by the rewrite control program occurs, changes will occur in, for example, addresses designated in the user code/data. As a result, in a microcomputer according to the third example of the prior art, the user code/data must be changed in order to deal with such modifications of address designation even when there is no actual need for change of the content. In other words, in the third example of the prior art, there exists the problem that even user code/data that fundamentally require no change in content must be newly produced as the result of, for example, modifications of the rewrite control program.